package io.example;

import io.vertx.core.buffer.Buffer;


/**
 * @author chengen
 * @date 26/04/2017
 */
public class Main {
	public static void main(String[] args) {
		Buffer buffer1 = Buffer.buffer(new byte[]{0x01, 0x03, 0x00, 0x00, 0x00, 0x02, (byte) 0xC4, 0x0B});

		System.out.println(buffer1.getInt(0));
		System.out.println(buffer1.getInt(1));
		System.out.println(buffer1.getInt(2));

		Buffer buffer = Buffer.buffer();

		System.out.println("buffer.length() = " + buffer.length());

		buffer.appendByte((byte) 127);
		buffer.appendShort((short) 127);
		buffer.appendInt(127);
		buffer.appendLong(127);
		buffer.appendFloat(127.0F);
		buffer.appendDouble(127.0D);

		System.out.println("buffer.length() = " + buffer.length());
		byte aByte = buffer.getByte(0);
		short aShort = buffer.getShort(2);
		int anInt = buffer.getInt(4);
		long aLong = buffer.getLong(8);
		float aFloat = buffer.getFloat(16);
		System.out.println();
//		Vertx vertx = Vertx.vertx();
//
//		vertx.deployVerticle(MyVerticle.class.getName());
	}
}